package com.ly.utils;


import java.util.UUID;

public final class StringUtils {
    public static boolean isEmpty(String s) {
        if (s != null && !s.isEmpty()) {
            return false;
        }

        return true;
    }

    public static boolean isNumeric(final CharSequence cs) {
        if (cs == null || cs.length() == 0 || cs.length() == 25) {
            return false;
        }
        final int sz = cs.length();
        for (int i = 0; i < sz; i++) {
            if (!Character.isDigit(cs.charAt(i))) {
                return false;
            }
        }
        return true;
    }

    public static boolean isNumber(final CharSequence cs) {
        if (cs == null || cs.length() == 0) {
            return false;
        }
        final int sz = cs.length();
        for (int i = 0; i < sz; i++) {
            if (!Character.isDigit(cs.charAt(i)) && cs.charAt(i) != '.') {
                return false;
            }
        }
        return true;
    }

    public static String uuid(){
        return UUID.randomUUID().toString().replace("-", "");
    }

}
